#include "stdio.h"
#include "lcd.h"
#include "bmp.h"
#include <wiringPi.h>

unsigned int i;


void Writ_Bus(u8 dat) 
{	
  u8 i;
	for(i=0;i<8;i++)
	{			  
		OLED_SCLK_Clr();
		if(dat&0x80)
		   OLED_SDIN_Set();
		else 
		   OLED_SDIN_Clr();
		OLED_SCLK_Set();
		dat<<=1;   
	}			
}

unsigned int col=GREEN;

int main(void)
{
    Lcd_Init();

	LCD_Clear(GREEN);
	BACK_COLOR=WHITE;
	// LCD_ShowString(22,60,"1.8 TFT SPI",RED);
	// LCD_ShowString(22,80,"LCD_W:",RED);	LCD_ShowNum(82,80,LCD_W,3,RED);
	// LCD_ShowString(22,100,"LCD_H:",RED);LCD_ShowNum(82,100,LCD_H,3,RED);

    OLED_CS_Clr();
    while(1)
    {
    //   LCD_Clear(GREEN);
    //   Delay_ms(10);

    //   LCD_Clear(RED);
    //   Delay_ms(10);

    //   LCD_Clear(YELLOW);
    //   Delay_ms(10);

    //   LCD_Clear(GRAY);
    //   Delay_ms(10);

    //   LCD_Clear(WHITE);
    //   Delay_ms(10); 	
	
    for(i=0;i<LCD_W*LCD_H;i++)
    {
      	Writ_Bus(col>>8);
	    Writ_Bus(col);
    }
	col+=100;

    }
    return 0;
}